home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 January: Mac OS SDK / Dev.CD Jan 00 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Start.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  11.8 KB  |  321 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Start.h
  3.  
  4.      Contains:    Start Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1987-1993, 1996-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __START__
  19. #define __START__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50. /*
  51.     Important: When the major version number of kExtensionTableVersion and the value
  52.     returned by gestaltExtensionTableVersion change, it indicates that the Extension
  53.     Table startup mechanism has radically changed and code that doesn't know about
  54.     the new major version must not attempt to use the Extension Table startup
  55.     mechanism.
  56.     
  57.     Changes to the minor version number of kExtensionTableVersion indicate that the
  58.     definition of the ExtensionElement structure has been extended, but the fields
  59.     defined for previous minor versions of kExtensionTableVersion have not changed.
  60. */
  61.  
  62. enum {
  63.     kExtensionTableVersion        = 0x00000100                    /* current ExtensionTable version (1.0.0) */
  64. };
  65.  
  66. /* ExtensionNotification message codes */
  67.  
  68. enum {
  69.     extNotificationBeforeFirst    = 0,                            /* Before any extensions have loaded */
  70.     extNotificationAfterLast    = 1,                            /* After all extensions have loaded */
  71.     extNotificationBeforeCurrent = 2,                            /* Before extension at extElementIndex is loaded */
  72.     extNotificationAfterCurrent    = 3                                /* After extension at extElementIndex is loaded */
  73. };
  74.  
  75.  
  76. struct ExtensionElement {
  77.     Str31                             fileName;                    /* The file name */
  78.     long                             parentDirID;                /* the file's parent directory ID */
  79.                                                                 /* and everything after ioNamePtr in the HParamBlockRec.fileParam variant */
  80.     short                             ioVRefNum;                    /* always the real volume reference number (not a drive, default, or working dirID) */
  81.     short                             ioFRefNum;
  82.     SInt8                             ioFVersNum;
  83.     SInt8                             filler1;
  84.     short                             ioFDirIndex;                /* always 0 in table */
  85.     SInt8                             ioFlAttrib;
  86.     SInt8                             ioFlVersNum;
  87.     FInfo                             ioFlFndrInfo;
  88.     long                             ioDirID;
  89.     unsigned short                     ioFlStBlk;
  90.     long                             ioFlLgLen;
  91.     long                             ioFlPyLen;
  92.     unsigned short                     ioFlRStBlk;
  93.     long                             ioFlRLgLen;
  94.     long                             ioFlRPyLen;
  95.     unsigned long                     ioFlCrDat;
  96.     unsigned long                     ioFlMdDat;
  97. };
  98. typedef struct ExtensionElement            ExtensionElement;
  99. typedef ExtensionElement *                ExtensionElementPtr;
  100.  
  101. struct ExtensionTableHeader {
  102.     UInt32                             extTableHeaderSize;            /* size of ExtensionTable header ( equal to offsetof(ExtensionTable, extElements[0]) ) */
  103.     UInt32                             extTableVersion;            /* current ExtensionTable version (same as returned by gestaltExtTableVersion Gestalt selector) */
  104.     UInt32                             extElementIndex;            /* current index into ExtensionElement records (zero-based) */
  105.     UInt32                             extElementSize;                /* size of ExtensionElement */
  106.     UInt32                             extElementCount;            /* number of ExtensionElement records in table (1-based) */
  107. };
  108. typedef struct ExtensionTableHeader        ExtensionTableHeader;
  109.  
  110. struct ExtensionTable {
  111.     ExtensionTableHeader             extTableHeader;                /* the ExtensionTableHeader */
  112.     ExtensionElement                 extElements[1];                /* one element for each extension to load */
  113. };
  114. typedef struct ExtensionTable            ExtensionTable;
  115. typedef ExtensionTable *                ExtensionTablePtr;
  116. typedef ExtensionTablePtr *                ExtensionTableHandle;
  117. typedef CALLBACK_API( void , ExtensionNotificationProcPtr )(UInt32 message, void *param, ExtensionElementPtr extElement);
  118. typedef CALLBACK_API( void , ExtensionTableHandlerProcPtr )(UInt32 message, void *param, ExtensionTableHandle extTableHandle);
  119. typedef STACK_UPP_TYPE(ExtensionNotificationProcPtr)             ExtensionNotificationUPP;
  120. typedef STACK_UPP_TYPE(ExtensionTableHandlerProcPtr)             ExtensionTableHandlerUPP;
  121. enum { uppExtensionNotificationProcInfo = 0x00000FC0 };         /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  122. enum { uppExtensionTableHandlerProcInfo = 0x00000FC0 };         /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  123. #define NewExtensionNotificationProc(userRoutine)                 (ExtensionNotificationUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppExtensionNotificationProcInfo, GetCurrentArchitecture())
  124. #define NewExtensionTableHandlerProc(userRoutine)                 (ExtensionTableHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppExtensionTableHandlerProcInfo, GetCurrentArchitecture())
  125. #define CallExtensionNotificationProc(userRoutine, message, param, extElement)  CALL_THREE_PARAMETER_UPP((userRoutine), uppExtensionNotificationProcInfo, (message), (param), (extElement))
  126. #define CallExtensionTableHandlerProc(userRoutine, message, param, extTableHandle)  CALL_THREE_PARAMETER_UPP((userRoutine), uppExtensionTableHandlerProcInfo, (message), (param), (extTableHandle))
  127.  
  128. union DefStartRec {
  129.     struct {
  130.         SignedByte                         sdExtDevID;
  131.         SignedByte                         sdPartition;
  132.         SignedByte                         sdSlotNum;
  133.         SignedByte                         sdSRsrcID;
  134.     }                                 slotDev;
  135.     struct {
  136.         SignedByte                         sdReserved1;
  137.         SignedByte                         sdReserved2;
  138.         short                             sdRefNum;
  139.     }                                 scsiDev;
  140. };
  141. typedef union DefStartRec                DefStartRec;
  142.  
  143. typedef DefStartRec *                    DefStartPtr;
  144.  
  145. struct DefVideoRec {
  146.     SignedByte                         sdSlot;
  147.     SignedByte                         sdsResource;
  148. };
  149. typedef struct DefVideoRec                DefVideoRec;
  150.  
  151. typedef DefVideoRec *                    DefVideoPtr;
  152.  
  153. struct DefOSRec {
  154.     SignedByte                         sdReserved;
  155.     SignedByte                         sdOSType;
  156. };
  157. typedef struct DefOSRec                    DefOSRec;
  158.  
  159. typedef DefOSRec *                        DefOSPtr;
  160.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  161.                                                                                             #pragma parameter GetDefaultStartup(__A0)
  162.                                                                                             #endif
  163. EXTERN_API( void )
  164. GetDefaultStartup                (DefStartPtr             paramBlock)                            ONEWORDINLINE(0xA07D);
  165.  
  166.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  167.                                                                                             #pragma parameter SetDefaultStartup(__A0)
  168.                                                                                             #endif
  169. EXTERN_API( void )
  170. SetDefaultStartup                (DefStartPtr             paramBlock)                            ONEWORDINLINE(0xA07E);
  171.  
  172.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  173.                                                                                             #pragma parameter GetVideoDefault(__A0)
  174.                                                                                             #endif
  175. EXTERN_API( void )
  176. GetVideoDefault                    (DefVideoPtr             paramBlock)                            ONEWORDINLINE(0xA080);
  177.  
  178.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  179.                                                                                             #pragma parameter SetVideoDefault(__A0)
  180.                                                                                             #endif
  181. EXTERN_API( void )
  182. SetVideoDefault                    (DefVideoPtr             paramBlock)                            ONEWORDINLINE(0xA081);
  183.  
  184.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  185.                                                                                             #pragma parameter GetOSDefault(__A0)
  186.                                                                                             #endif
  187. EXTERN_API( void )
  188. GetOSDefault                    (DefOSPtr                 paramBlock)                            ONEWORDINLINE(0xA084);
  189.  
  190.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  191.                                                                                             #pragma parameter SetOSDefault(__A0)
  192.                                                                                             #endif
  193. EXTERN_API( void )
  194. SetOSDefault                    (DefOSPtr                 paramBlock)                            ONEWORDINLINE(0xA083);
  195.  
  196. EXTERN_API( void )
  197. SetTimeout                        (short                     count);
  198.  
  199. EXTERN_API( void )
  200. GetTimeout                        (short *                count);
  201.  
  202. /*
  203.     InstallExtensionNotificationProc
  204.  
  205.     Installs an ExtensionNotificationUPP.
  206.  
  207.     Parameters:
  208.         extNotificationProc    The ExtensionNotificationUPP to install.
  209.  
  210.     Results:
  211.         noErr        0        The ExtensionNotificationUPP was installed.
  212.         paramErr    -50        This ExtensionNotificationUPP has already been installed.
  213.         memFullErr    -108    Not enough memory to install the ExtensionNotificationUPP.
  214. */
  215. EXTERN_API( OSErr )
  216. InstallExtensionNotificationProc (ExtensionNotificationUPP  extNotificationProc)            TWOWORDINLINE(0x7000, 0xAA7D);
  217.  
  218.  
  219. /*
  220.     RemoveExtensionNotificationProc
  221.  
  222.     Removes an ExtensionNotificationUPP.
  223.     
  224.     Note:    ExtensionNotificationUPPs can't call RemoveExtensionNotificationProc.
  225.  
  226.     Parameters:
  227.         extNotificationProc    The ExtensionNotificationUPP to remove.
  228.  
  229.     Results:
  230.         noErr        0        The ExtensionNotificationUPP was removed.
  231.         paramErr    -50        The ExtensionNotificationUPP was not found, or
  232.                             RemoveExtensionNotificationProc was called from within
  233.                             a ExtensionNotificationUPP (ExtensionNotificationUPPs can't
  234.                             call RemoveExtensionNotificationProc).
  235. */
  236. EXTERN_API( OSErr )
  237. RemoveExtensionNotificationProc    (ExtensionNotificationUPP  extNotificationProc)                TWOWORDINLINE(0x7001, 0xAA7D);
  238.  
  239.  
  240. /*
  241.     InstallExtensionTableHandlerProc
  242.  
  243.     Installs an ExtensionTableHandlerUPP. Control is taken away from the system's default
  244.     handler and the ExtensionTableHandlerUPP is responsible for all changes to the
  245.     ExtensionTable (except for incrementing extElementIndex between extensions). This is
  246.     always the first handler called with extNotificationBeforeFirst and
  247.     extNotificationBeforeCurrent messages and the last handler called with
  248.     extNotificationAfterLast and extNotificationAfterCurrent messages. extElementIndex
  249.     is always incremented immediately after the ExtensionTableHandlerUPP is called with
  250.     the extNotificationAfterCurrent message.
  251.     
  252.     There can only be one ExtensionTableHandler installed.
  253.     
  254.     Warning:    The only safe time to change what ExtensionElement is at
  255.                 ExtensionTable.extElements[extElementIndex] is when your
  256.                 ExtensionTableHandlerUPP is called with the extNotificationAfterCurrent
  257.                 message. You may change the ExtensionTable or the extElementIndex at other
  258.                 times, but you must ensure that the ExtensionElement at
  259.                 ExtensionTable.extElements[extElementIndex] stays the same.
  260.                 
  261.     Note:        If the ExtensionTable or the contents of the folders included in the
  262.                 ExtensionTable are changed after installing an ExtensionTableHandler,
  263.                 RemoveExtensionTableHandlerProc cannot be called.
  264.  
  265.     Parameters:
  266.         extMgrProc            The ExtensionTableHandlerUPP to install.
  267.         extTable            A pointer to an ExtensionTableHandle where
  268.                             InstallExtensionTableHandlerProc will return the current
  269.                             ExtensionTableHandle. You don't own the handle itself and
  270.                             must not dispose of it, but you can change the extElementIndex.
  271.                             the extElementCount, and the ExtensionElements in the table.
  272.  
  273.     Results:
  274.         noErr        0        The ExtensionTableHandlerUPP was installed.
  275.         paramErr    -50        Another ExtensionTableHandlerUPP has already been installed.
  276.         memFullErr    -108    Not enough memory to install the ExtensionTableHandlerUPP.
  277. */
  278. EXTERN_API( OSErr )
  279. InstallExtensionTableHandlerProc (ExtensionTableHandlerUPP  extMgrProc,
  280.                                  ExtensionTableHandle *    extTable)                            TWOWORDINLINE(0x7002, 0xAA7D);
  281.  
  282.  
  283. /*
  284.     RemoveExtensionTableHandlerProc
  285.  
  286.     Remove an ExtensionTableUPP. Control is passed back to the default handler.
  287.  
  288.     Parameters:
  289.         extMgrProc            The ExtensionTableUPP to remove.
  290.  
  291.     Results:
  292.         noErr        0        The ExtensionTableUPP was removed.
  293.         paramErr    -50        This ExtensionTableUPP was not installed,
  294.                             or the ExtensionTable no longer matches the
  295.                             original boot ExtensionTable.
  296. */
  297. EXTERN_API( OSErr )
  298. RemoveExtensionTableHandlerProc    (ExtensionTableHandlerUPP  extMgrProc)                        TWOWORDINLINE(0x7003, 0xAA7D);
  299.  
  300.  
  301. #if PRAGMA_STRUCT_ALIGN
  302.     #pragma options align=reset
  303. #elif PRAGMA_STRUCT_PACKPUSH
  304.     #pragma pack(pop)
  305. #elif PRAGMA_STRUCT_PACK
  306.     #pragma pack()
  307. #endif
  308.  
  309. #ifdef PRAGMA_IMPORT_OFF
  310. #pragma import off
  311. #elif PRAGMA_IMPORT
  312. #pragma import reset
  313. #endif
  314.  
  315. #ifdef __cplusplus
  316. }
  317. #endif
  318.  
  319. #endif /* __START__ */
  320.  
  321.